<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="../assets/css/base.css">
  <style>
    div>div {
      width: 200px;
      border: 1px solid black;
    }

    .ellipsis {
      /* 隐藏超出范围的内容 */
      overflow: hidden;
      /* 文本不换行 */
      white-space: nowrap;
      /* 用 ... 表示超出范围的文本 */
      text-overflow: ellipsis;
    }

    .ellipsis2 {
      display: -webkit-box;
      line-clamp: 2;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      white-space: normal;
      text-overflow: ellipsis;
    }
  </style>
</head>

<body>
  <div class="float-left margin-left-10">
    <p class="title">单行文本省略</p>
    <div class="ellipsis">Hello world! Hello world! Hello world! Hello world! Hello world!</div>
  </div>

  <div class="float-left margin-left-10">
    <p class="title">多行文本省略</p>
    <div class="ellipsis2">Hello world! Hello world! Hello world! Hello world! Hello world!</div>
  </div>
</body>

</html>